import { Router, Request, Response, NextFunction } from 'express'
import * as userService from '../service/user.service'

const userRouter = Router()


userRouter.get('/api/user/register', function (req: Request, res: Response, next: NextFunction) {
    userService.userRegister(req.query['userPhone'], req.query['userPass'], req.query['userStuId']).then(data => {
        if (data != null)
            res.json({
                code: 0,
                token: data
            })
        else
            res.json({
                code: 1
            })
    })
})

export default userRouter